package com.cium.aqie

/**
 * @Function:
 * @Author: aqie
 * @Date: 2019/8/27 8:47
 */
val FINAL_HELLO_WORLD: String = "Aqie"
var helloWorld: String = FINAL_HELLO_WORLD
var nullableHelloWorld: String? = helloWorld
val helloWorldArray: Array<Char> = arrayOf('H', 'e', 'l', 'l', 'o', 'W', 'o', 'r', 'l', 'd')
val helloWorldCharArray: CharArray = charArrayOf('H', 'e', 'l', 'l', 'o', 'W', 'o', 'r', 'l', 'd')
val helloWorldLength: Int = helloWorld.length
val helloWorldLengthLong: Long = helloWorldLength.toLong()

// 编译期常量
const val FINAL_AQIE: String = "HelloWorld"
var aqie: String = FINAL_AQIE

val FINAL_HELLO_CHINA = "HelloChina"

fun main() {
    print("Hello World")

    println("final hello world: $FINAL_HELLO_WORLD")
    println("assignable hello world: " + helloWorld)
    println("hello world from nullable type: " + nullableHelloWorld)
    println("hello world from Array: " + helloWorldArray.joinToString(""))
    println("hello world from CharArray: " + String(helloWorldCharArray))
    println("class name hello world: " + Aqie::class.java.simpleName)
    println("class name hello world: " + Aqie::class.java.name)
    println("part of the class name of HelloWorld: "
            + Aqie::class.java.simpleName.slice(0 until helloWorldLength)) // [0, 3)
    println("the length of hello world is : " + helloWorldLength)
    println("the length of hello world is (long): " + helloWorldLengthLong)
}